package org.sample.springboot.validator.constraints.optional.annotation;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import org.sample.springboot.validator.AnnotationOptionalValidator;

@Retention(RUNTIME)
@Target({ TYPE, FIELD })
@Constraint(validatedBy = AnnotationOptionalValidator.class)
@Documented
public @interface AnnotationOptionalConstraint {
	
	String name() default "";

	/**
	 * Value of enableField that enable validate optional field.
	 */
	boolean enableValue();

	/**
	 * Indicates enable validate when enableField is null.
	 */
	boolean enableForNull();

	String message() default "";

	Class<?>[] groups() default {};

	Class<? extends Payload>[] payload() default {};

}
